.daai-button {
    // 首先针对这个样式类里面，定义了一系列的样式变量
    --daai-button-font-weight: var(--daai-font-weight-primary);
    --daai-button-border-color: var(--daai-border-color);
    --daai-button-bg-color: var(--daai-fill-color-blank);
    --daai-button-text-color: var(--daai-text-color-regular);
    --daai-button-disabled-text-color: var(--daai-disabled-text-color);
    --daai-button-disabled-bg-color: var(--daai-fill-color-blank);
    --daai-button-disabled-border-color: var(--daai-border-color-light);
    --daai-button-hover-text-color: var(--daai-color-primary);
    --daai-button-hover-bg-color: var(--daai-color-primary-light-9);
    --daai-button-hover-border-color: var(--daai-color-primary-light-7);
    --daai-button-active-text-color: var(--daai-button-hover-text-color);
    --daai-button-active-border-color: var(--daai-color-primary);
    --daai-button-active-bg-color: var(--daai-button-hover-bg-color);
    --daai-button-outline-color: var(--daai-color-primary-light-5);
    --daai-button-active-color: var(--daai-text-color-primary);
}

.daai-button {
    // 接下来再来书写基本的样式
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    height: 40px;
    background-color: var(--daai-button-bg-color);
    border: var(--daai-border);
    border-color: var(--daai-button-border-color);
    color: var(--daai-button-text-color);
    appearance: none;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    margin: 0;
    transition: 0.1s;
    font-weight: var(--daai-button-font-weight);
    user-select: none;
    vertical-align: middle;
    padding: 12px 20px;
    font-size: var(--daai-font-size-base);
    border-radius: var(--daai-border-radius-base);

    &:hover,
    &:focus {
        color: var(--daai-button-hover-text-color);
        border-color: var(--daai-button-hover-border-color);
        background-color: var(--daai-button-hover-bg-color);
        outline: none;
    }

    &:active {
        color: var(--daai-button-active-text-color);
        border-color: var(--daai-button-active-border-color);
        background-color: var(--daai-button-active-bg-color);
        outline: none;
    }

    &.is-round {
        border-radius: var(--daai-border-radius-round);
    }

    &.is-circle {
        width: 45px;
        height: 45px;
        border-radius: 50%;
        padding: 12px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    // 禁用相关的样式
    &.is-disabled,
    &.is-disabled:hover,
    &.is-disabled:focus,
    &[disabled],
    &[disabled]:hover,
    &[disabled]:focus {
        color: var(--daai-button-disabled-text-color);
        cursor: not-allowed;
        background-image: none;
        background-color: var(--daai-button-disabled-bg-color);
        border-color: var(--daai-button-disabled-border-color);
    }

    [class*='daai-icon']+span {
        margin-left: 6px;
        position: relative;
    }
}

@each $val in primary,
success,
warning,
info,
danger {

    // 这是一种非常灵活的方式，通过挂上去一些类，改变 CSS 变量所对应的值
    .daai-button--#{$val} {
        --daai-button-text-color: var(--daai-color-white);
        --daai-button-bg-color: var(--daai-color-#{$val});
        --daai-button-border-color: var(--daai-color-#{$val});
        --daai-button-outline-color: var(--daai-color-#{$val}-light-5);
        --daai-button-active-color: var(--daai-color-#{$val}-dark-2);
        --daai-button-hover-text-color: var(--daai-color-white);
        --daai-button-hover-bg-color: var(--daai-color-#{$val}-light-3);
        --daai-button-hover-border-color: var(--daai-color-#{$val}-light-3);
        --daai-button-active-bg-color: var(--daai-color-#{$val}-dark-2);
        --daai-button-active-border-color: var(--daai-color-#{$val}-dark-2);
        --daai-button-disabled-text-color: var(--daai-color-white);
        --daai-button-disabled-bg-color: var(--daai-color-#{$val}-light-5);
        --daai-button-disabled-border-color: var(--daai-color-#{$val}-light-5);
    }

    // 如果挂了 is-plain 这个，那么同样是改变一些 CSS 变量的值
    .daai-button--#{$val}.is-plain {
        --daai-button-text-color: var(--daai-color-#{$val});
        --daai-button-bg-color: var(--daai-color-#{$val}-light-9);
        --daai-button-border-color: var(--daai-color-#{$val}-light-5);
        --daai-button-hover-text-color: var(--daai-color-white);
        --daai-button-hover-bg-color: var(--daai-color-#{$val});
        --daai-button-hover-border-color: var(--daai-color-#{$val});
        --daai-button-active-text-color: var(--daai-color-white);
    }
}

// 针对 daai-button-large 以及 daai-button-small 书写相应的样式即可
.daai-button--large {
    --daai-button-size: 50px;
    height: var(--daai-button-size);
    padding: 12px 19px;
    font-size: var(--daai-font-size-base);
    border-radius: var(--daai-border-radius-base);
}

.daai-button--small {
    --daai-button-size: 24px;
    height: var(--daai-button-size);
    padding: 5px 11px;
    font-size: 12px;
    border-radius: calc(var(--daai-border-radius-base) - 1px);
}